home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 5.1 KB | 135 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // URowSelectApplication.cp
- // Copyright © 1991-96 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- #ifndef __UApplicationRowSelect__
- #include "UApplicationRowSelect.h"
- #endif
-
- #ifndef __UDocumentRowSelect__
- #include "UDocumentRowSelect.h"
- #endif
-
- // MacApp Includes
-
- #ifndef __UMENUMGR__
- #include "UMenuMgr.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Constants:
-
- const OSType kSignature = 'SS01'; // Application signature
-
- //========================================================================================
- // CLASS TApplicationRowSelect
- //========================================================================================
- #undef Inherited
- #define Inherited TApplication
-
- #pragma segment AInit
- MA_DEFINE_CLASS_M1(TApplicationRowSelect, Inherited);
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect constructor
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TApplicationRowSelect::TApplicationRowSelect()
- {
- // Initialize fields to safe values here
- }
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect destructor
- //----------------------------------------------------------------------------------------
- #pragma segment MADestructorRes
-
- TApplicationRowSelect::~TApplicationRowSelect()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect::IApplicationRowSelect:
- //----------------------------------------------------------------------------------------
- #pragma segment AInit
-
- void TApplicationRowSelect::IApplicationRowSelect()
- {
- this->IApplication(kFileType, kSignature);
- } // TApplicationRowSelect::IApplicationRowSelect
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect::DoMakeDocument: This method is overridden to return a document
- // object of the appropriate class for this application. MacApp calls this method when the
- // user chooose New or Open from the File menu. For applications which hande multiple
- // document types, the command number can be used to discriminate between different user
- // requests. The file object represents the file chosen by the user in the Standard File
- // dialog.
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TDocument* TApplicationRowSelect::DoMakeDocument(CommandNumber /* itsCommandNumber */,
- TFile* itsFile) // Override
- {
- TDocumentRowSelect* aDocument = new TDocumentRowSelect;
-
- aDocument->IDocumentRowSelect(itsFile,kSignature);
- return aDocument;
- } // TApplicationRowSelect::DoMakeDocument
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect::DoMenuCommand: This method is overridden to handle menu items
- // which are enabled when this object is in the target chain. The application object is
- // always in the target chain.
- //
- // The inherited method is called so that MacApp can handle application-level menu items
- // like the "About " menu item in the Apple menu.
- //----------------------------------------------------------------------------------------
- #pragma segment ASelCommand
-
- void TApplicationRowSelect::DoMenuCommand(CommandNumber aCommandNumber) // Override
- {
- switch (aCommandNumber)
- {
- /* Typically, you will have dispatch your own menu commands here:
- case cCommandHandledByApplication :
- SysBeep(2);
- break;
- */
- default:
- Inherited::DoMenuCommand(aCommandNumber);
- break;
- }
- } // TApplicationRowSelect::DoMenuCommand
-
- //----------------------------------------------------------------------------------------
- // TApplicationRowSelect::DoSetupMenus: This method is overridden to enable menu items
- // which should be enabled when this object is in the target chain. MacApp initially
- // disables all menu items, then lets the objects in the target chain enable those items
- // they handle.
- //
- // The application object is always in the target chain, so the About menu item in the
- // Apple menu and the item with command number cMenuHandledByApplication should be enabled
- // even if there are no open documents.
- //
- // The inherited method is called so that MacApp can enable application-level menu items
- // like the "About " menu item.
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- void TApplicationRowSelect::DoSetupMenus() // Override
- {
- Inherited::DoSetupMenus(); // Always call the inherited method first
-
- /* Typically, you will have enable your own menu commands here:
- Enable(cCommandHandledByApplication,TRUE);
- */
- } // TApplicationRowSelect::DoSetupMenus
-
- //----------------------------------------------------------------------------------------
- // End of UApplicationRowSelect.cp
-
- #pragma segment Inline
-